-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve contours caching calculation #3243
base: main
Are you sure you want to change the base?
Conversation
Deploying nmrium with Cloudflare Pages
|
@hamed-musallam This is the POC of the cache. I just quickly did it as a global variable but it should of course be done at the level of each spectra using I guess a useRef. I also did a small fix in ml-conrec to improve performances when nothing should be calculated. Once done we will ask Michael to check if it is ok. |
If a check the size of the cache
I read 414. There could be an issue with rounding calculating the different levels ? I think calculate the possible levels should be done once for ever per spectrum to avoid this issue. |
723f106
to
5c12840
Compare
@targos Here are some comments / ideas. If both positive and negative curves need to be calculated we should think about doing both at once. It seems much faster. In conrec it would be better to have a limit in the number of segment per layer. Currently we have only a global timeout and if this timeout is reached nothing will be displayed. This could also prevent some crash with out of memory despite the fact that we are using typed array in order to limit this risk. We could think about having fifo-logger sent to conrec to get some debug information as well as the error if the timeout was reached. Conrec could work in a worker. There are only 101 levels possible for positive and negative. We could start calculations for the 10 default levels and possibly start in a webworker the calculation of the other 91 levels. Because we are using typedarray the transfer of the data should be fast. We could still make some profiling to determine the limiting speed step. We also need to be certain that only 101 levels are practically calculated. The goal is to be able to vertically scale smoothly the following spectrum (from Perth) |
No description provided.